package br.com.internetbanking.DAO;

import java.io.Serializable;

import org.hibernate.Transaction;
import org.hibernate.classic.Session;

import br.com.internetbanking.hibernate.HibernateUtils;


public  class BaseDAO implements Serializable {

	private Class classe = null;
	
	public BaseDAO(Class classe){
		this.classe = classe;
	}
	
	public void salvar(Object obj){
		try{
			Session session = HibernateUtils.getSessao();
			Transaction tx = session.beginTransaction();
			session.save(obj);
			tx.commit();
			session.close();
		}catch (Exception e) {
			e.printStackTrace();
		}
	}

}
